package com.hys.vo;

import com.hys.param.*;
import com.hys.service.DictService;
import com.hys.service.impl.DictServiceImpl;
import com.hys.util.BeanUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel(description = "excel 导出的实体类")
public class CooperExcelVO {

    @ApiModelProperty("企业名称")
    private String name;

    @ApiModelProperty("统一社会信用代码")
    private String creditCode;

    @ApiModelProperty("企业类型")
    private String type;

    @ApiModelProperty("企业性质")
    private String nature;

    @ApiModelProperty("对应专业")
    private String major;

    @ApiModelProperty("是否签订协议")
    private Boolean isAgreeSigned;

    @ApiModelProperty("本学年捐赠学校设备值")
    private Double donValue;

    @ApiModelProperty("本学年准捐赠学校设备值")
    private Double donPredictValue;

    @ApiModelProperty("捐赠明细")
    private String donDetail;

    @ApiModelProperty("奖学金-总额")
    private Double schShipCount;

    @ApiModelProperty("奖学金-金额")
    private Double schShipFigure;

    @ApiModelProperty("设立的奖学金名称")
    private String schShipName;

    @ApiModelProperty("合计-人")
    private Integer accGraduateSum;

    @ApiModelProperty("接收近三届毕业生(除当年)总数")
    private Integer accGraduateRecent;

    @ApiModelProperty("接收应届毕业生人数人总数")
    private Integer accGraduateCurrent;

    @ApiModelProperty("接收学校专业课教师()人")
    private Integer accGraduateTeacher;

    @ApiModelProperty("挂职教师明细")
    private String accGraduateTeaDetail;

    @ApiModelProperty("接受实习生人")
    private Integer accGraduatePrNum;

    @ApiModelProperty("支付学生实习（）平均值")
    private Integer accGraduatePrReward;

    @ApiModelProperty("是否提供保险")
    private Boolean accGraduateInsurance;

    @ApiModelProperty("是否提供住宿")
    private Boolean accGraduateStay;

    @ApiModelProperty("课程数量")
    private Integer courseCount;

    @ApiModelProperty("课程名称")
    private String courseName;

    @ApiModelProperty("教材总数")
    private Integer bookKind;

    @ApiModelProperty("教材名称")
    private String bookName;

    @ApiModelProperty("参与竞赛名称")
    private String joinMatchName;

    @ApiModelProperty("支持学校行业导师人数")
    private Integer supportSchoolNum;

    @ApiModelProperty("订单培养数")
    private Integer orderNum;

    @ApiModelProperty("是否开展学徒制")
    private Boolean isApprentice;

    @ApiModelProperty("共建产教实训基地")
    private String trainingBase;

    @ApiModelProperty("学校为企业年培训员工数")
    private Integer orderForEnterNum;

    @ApiModelProperty("技术开发")
    private Double teachDev;

    @ApiModelProperty("技术转让")
    private Double teachMakeOver;

    @ApiModelProperty("技术许可")
    private Double teachPermission;

    @ApiModelProperty("技术咨询")
    private Double teachConsult;

    @ApiModelProperty("技术服务")
    private Double teachService;

    @ApiModelProperty("发明专利")
    private Integer patentDevelop;

    @ApiModelProperty("实用新型专利")
    private Integer patentPractical;

    @ApiModelProperty("外观设计专利")
    private Integer patentAspect;

    @ApiModelProperty("软件著作权")
    private Integer softCopyRight;

    @ApiModelProperty("纵向项目数")
    private Integer projectNumber;

    @ApiModelProperty("填报人")
    private String createUser;

    @ApiModelProperty("状态")
    private String status;

    public CooperAddOrUpdateParam convertToCooperParam( DictService dictService ) {

        CooperAddOrUpdateParam cooperAddOrUpdateParam = new CooperAddOrUpdateParam();
        EnterpriseParam enter = BeanUtil.transform(EnterpriseParam.class, this);

        CooperInfoParam cooperInfo = BeanUtil.transform(CooperInfoParam.class, this);
        cooperInfo.setEnterpriseContactPerson("无");
        cooperInfo.setEnterpriseContactPhone("无");
        cooperInfo.setSchoolContactPerson("无");
        String typeKey = dictService.getValueByKey(DictServiceImpl.enterType, this.type);
        String natureKey = dictService.getValueByKey(DictServiceImpl.enterSize, this.nature);
        String majorKey = dictService.getValueByKey(DictServiceImpl.major, this.major);

        enter.setType(typeKey);
        enter.setNature(natureKey);
        cooperInfo.setMajor(majorKey);
        // 设置默认值
        CooperMethodParam cooperMethod = BeanUtil.transform(CooperMethodParam.class, this);
        cooperMethod.setIsDefault();

        // 设置默认值
        CooperContentParam cooperContent = BeanUtil.transform(CooperContentParam.class, this);
        cooperContent.setIsDefault();

        cooperAddOrUpdateParam.setEnterpriseParam(enter);
        cooperAddOrUpdateParam.setCooperInfoParam(cooperInfo);
        cooperAddOrUpdateParam.setCooperMethodParam(cooperMethod);
        cooperAddOrUpdateParam.setCooperContentParam(cooperContent);

        return cooperAddOrUpdateParam;
    }
}
